home *** CD-ROM | disk | FTP | other *** search
- this.stop();
- FNscore = function(s, num)
- {
- var _loc2_ = 1;
- while(_loc2_ <= 7)
- {
- this.menu_mc[s + _loc2_].gotoAndStop(Math.floor(num / Math.pow(10,_loc2_ - 1)) % 10 + 1);
- _loc2_ = _loc2_ + 1;
- }
- };
- FNimg = function()
- {
- img = new Array();
- var _loc1_ = 0;
- while(_loc1_ <= 19)
- {
- if(_loc1_ < 11)
- {
- img[_loc1_] = _loc1_ + 1;
- }
- else
- {
- img[_loc1_] = _loc1_ - 11;
- }
- _loc1_ = _loc1_ + 1;
- }
- _loc1_ = 0;
- while(_loc1_ < 50)
- {
- var _loc3_ = random(20);
- var _loc2_ = random(20);
- var _loc4_ = img[_loc3_];
- img[_loc3_] = img[_loc2_];
- img[_loc2_] = _loc4_;
- _loc1_ = _loc1_ + 1;
- }
- trace(img);
- img[19] = 1;
- };
- FNimg();
- FNchogi = function()
- {
- game_ok = false;
- level = 1;
- FNscore("l",level);
- score = 0;
- FNscore("s",score);
- life = 4;
- this.menu_mc.life.gotoAndStop(life);
- mission = 10;
- FNscore("m",mission);
- current = 0;
- FNscore("c",current);
- speed = 30 - (level - 1);
- time = 15;
- add_time = 0;
- duplicate_time = 80 - (level - 1) * 5;
- player_depths = this.player.getDepth();
- text_depths = this.text_mc.getDepth();
- menu_depths = this.menu_mc.getDepth();
- stop_depths = this.stop_window.getDepth();
- link_depths = this.link_mc.getDepth();
- this.text_mc.swapDepths(22);
- this.menu_mc.swapDepths(23);
- this.stop_window.swapDepths(24);
- this.link_mc.swapDepths(25);
- this.text_mc.gotoAndStop("start");
- this.game_controler._visible = false;
- };
- FNchogi();
- FNlevelup = function()
- {
- level++;
- FNscore("l",level);
- current = 0;
- FNscore("c",current);
- if(level < 11)
- {
- speed = 30 - (level - 1);
- duplicate_time = 80 - (level - 1) * 5;
- }
- else
- {
- speed = 20;
- duplicate_time = 30;
- }
- add_time = 0;
- FNclear();
- this.player.swapDepths(player_depths);
- this.player.gotoAndStop(1);
- };
- FNclear = function()
- {
- var _loc2_ = 1;
- while(_loc2_ <= 20)
- {
- this["people" + _loc2_].gotoAndStop("clear");
- _loc2_ = _loc2_ + 1;
- }
- };
- FNgameover = function()
- {
- FNclear();
- this.text_mc.swapDepths(text_depths);
- this.menu_mc.swapDepths(menu_depths);
- this.stop_window.swapDepths(stop_depths);
- this.link_mc.swapDepths(link_depths);
- };
- people_depths = 20;
- FNpeople = function()
- {
- trace("duplicate");
- this.people_mc.duplicateMovieClip("people" + people_depths,people_depths);
- this["people" + people_depths]._x = 1;
- this["people" + people_depths]._y = 15;
- this["people" + people_depths].mc.gotoAndStop(img[people_depths - 1]);
- if(people_depths % 3 == 1)
- {
- this["people" + people_depths].mc.item.gotoAndStop(random(4) + 2);
- }
- this["people" + people_depths].move = true;
- this["people" + people_depths].talk = false;
- this["people" + people_depths].time = speed;
- this["people" + people_depths].move_i = 0;
- this["people" + people_depths].fall_ok = false;
- this["people" + people_depths].hit_ok = true;
- this["people" + people_depths].onEnterFrame = function()
- {
- if(_root.game_ok)
- {
- if(this.move)
- {
- this.move_i = this.move_i + 1;
- if(this.fall_ok)
- {
- this.mc.m.gotoAndStop(2);
- if(this.hitTest(_root.player.hit) && this.hit_ok)
- {
- this.hit_ok = false;
- if(this.mc.item._currentframe < 5)
- {
- if(this.mc.item._currentframe != 1)
- {
- if(this.mc.item._currentframe == 2)
- {
- if(_root.life < 4)
- {
- _root.life = _root.life + 1;
- }
- _root.menu_mc.life.gotoAndStop(_root.life);
- }
- else if(this.mc.item._currentframe == 3)
- {
- _root.add_time += 10;
- speed += _root.add_time;
- }
- else if(this.mc.item._currentframe == 4)
- {
- _root.rail_mc.gotoAndStop("ran");
- }
- }
- this.move_i = 0;
- this.fall_ok = false;
- this.talk = true;
- this.mc.m.gotoAndStop(1);
- this.hit_ok = true;
- this.nextFrame();
- _root.score += 3;
- _root.FNscore("s",score);
- }
- else
- {
- _root.life = _root.life - 1;
- _root.menu_mc.life.gotoAndStop(_root.life);
- if(_root.life == 1)
- {
- _root.game_ok = false;
- _root.game_controler._visible = false;
- _root.text_mc.gotoAndStop("gameover");
- }
- this.move = false;
- this.mc.gotoAndStop(this.mc._currentframe + 12);
- }
- this.mc.item.m.nextFrame();
- }
- else if(this.move_i % _root.time == 0)
- {
- if(this.mc.item._currentframe != 5)
- {
- if(Math.ceil(this._currentframe / 5) + 1 != _root.rail_mc._currentframe)
- {
- _root.life = _root.life - 1;
- _root.menu_mc.life.gotoAndStop(_root.life);
- if(_root.life == 1)
- {
- _root.game_ok = false;
- _root.game_controler._visible = false;
- _root.text_mc.gotoAndStop("gameover");
- }
- this.move = false;
- this.mc.m.gotoAndStop(3);
- }
- else if(this.hitTest(_root.rail_mc.hit))
- {
- _root.rail_mc.gotoAndStop(1);
- this.move_i = 0;
- this.fall_ok = false;
- this.mc.m.gotoAndStop(1);
- this.hit_ok = true;
- this.nextFrame();
- }
- }
- else
- {
- this.move_i = 0;
- this.fall_ok = false;
- this.mc.m.gotoAndStop(1);
- this.hit_ok = true;
- this.nextFrame();
- }
- }
- }
- else if(this.move_i % (this.time + _root.add_time) == 0)
- {
- this.move_i = 0;
- this.fall_ok = false;
- this.nextFrame();
- }
- }
- }
- };
- if(people_depths > 1)
- {
- people_depths--;
- }
- else
- {
- FNimg();
- people_depths = 20;
- }
- };
- FNplayer = function()
- {
- if(Key.isDown(38))
- {
- if(this.player._currentframe == 3 && this.rail_mc._currentframe != 3)
- {
- this.player.gotoAndStop(2);
- }
- else if(this.player._currentframe == 4 && this.rail_mc._currentframe != 2)
- {
- this.player.gotoAndStop(1);
- }
- }
- if(Key.isDown(40))
- {
- if(this.player._currentframe == 1 && this.rail_mc._currentframe != 5)
- {
- this.player.gotoAndStop(4);
- }
- else if(this.player._currentframe == 2 && this.rail_mc._currentframe != 4)
- {
- this.player.gotoAndStop(3);
- }
- }
- if(Key.isDown(39))
- {
- if(this.player._currentframe == 1 && this.rail_mc._currentframe != 3)
- {
- this.player.gotoAndStop(2);
- }
- else if(this.player._currentframe == 4 && this.rail_mc._currentframe != 4)
- {
- this.player.gotoAndStop(3);
- }
- }
- if(Key.isDown(37))
- {
- if(this.player._currentframe == 2 && this.rail_mc._currentframe != 2)
- {
- this.player.gotoAndStop(1);
- }
- else if(this.player._currentframe == 3 && this.rail_mc._currentframe != 5)
- {
- this.player.gotoAndStop(4);
- }
- }
- };
- duplicate_i = 0;
- duplicate_random = 72;
- this.onEnterFrame = function()
- {
- if(game_ok)
- {
- duplicate_i++;
- if(duplicate_i % (duplicate_random + add_time * 4) == 0)
- {
- duplicate_i = 0;
- duplicate_random = duplicate_time + random(50);
- FNpeople();
- }
- FNplayer();
- }
- };
-